//
//  HistoryCell.m
//  LuCaiZhu
//
//  Created by 邓龙 on 2019/4/25.
//

#import "HistoryCell.h"
#import "DBHelper.h"

@interface HistoryCell()
@property (weak, nonatomic) IBOutlet UILabel *date;
@property (weak, nonatomic) IBOutlet UILabel *net;
@property (weak, nonatomic) IBOutlet UILabel *rose;
@property (weak, nonatomic) IBOutlet UILabel *total;

@end

@implementation HistoryCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

- (void)setViewDataAction:(NSDictionary *)dic {
    NSDate *dateTime =  [DBHelper dateFromCustomString:dic[@"DocDate"] format:@"yyyy/MM/dd HH:mm:ss"];
    NSString *time = [DBHelper stringFromCustomFormatDate:dateTime format:@"yyyy-MM-dd"];
    _date.text = time;
    _net.text = dic[@"Net"];
    NSString *str = dic[@"MonthSumRose"];
    if (str.length > 0) {
        _rose.text = [NSString stringWithFormat:@"%@%%",dic[@"MonthSumRose"]];
    }
    else {
        _rose.text = @"";
    }
    _total.text = [NSString stringWithFormat:@"%@%@", dic[@"SumRose"], @"%"];
}

@end
